A digital image is an array of pixels, with each pixel having a digital value. Typically, in continuous tone black and white images the pixel values represent gray scale values.
Pixel values for an image have to conform to a specified range. For example, each array element may be one byte, i.e., eight bits. In this example, the pixel values range from 0 to 255. In a gray scale image, the 255 may represent absolute white, and the 0 may represent total black.
Color images include three color planes, generally corresponding to red, green, and blue (RGB). For a particular pixel, there is one value for each of these color planes, i.e., a value representing the red component, a value representing the green component, and a value representing the blue component. By varying the intensity of these three components, all colors in the color spectrum may be formed.
Many images, however, do not have pixel values that make effective use of the full dynamic range of available pixel values. For example, in the eight-bit example, a particular image may in its digital form only contain pixel values ranging from 100 to 150, i.e., the pixels fall somewhere in the middle of the gray scale. Similarly, an eight-bit color image may also have RGB values that fall within a range somewhere in middle of the range. The result in either case is that the output is relatively dull in appearance.
It is desirable, therefore, to enhance an image acquired by a camera or sensor to reveal additional detail in the image. For example, where images are taken in the presence of a bright light, details in shadows and in bright areas are often lost. Likewise, details are often lost in dark areas of dark images. As such, it is desirable to reveal such details without compromising overall image quality.
The visual appearance of an image may often be improved by remapping the pixel values to take advantage of the full range of possible outputs. That procedure is called contrast enhancement.
Contrast enhancement techniques are often based on histogram equalization. In histogram equalization, a histogram of gray level distribution of an image is constructed. A histogram is a one dimensional array with an array element corresponding to each value in the range of pixel values. Each histogram element contains a count of the number of pixels that has the particular pixel value corresponding to that element. In histogram equalization, the pixel values in the image are altered to make the distribution of gray level values as uniform as possible.
The present invention, as will be explained, improves upon the technique of histogram equalization.